package com.glsc.ngateway.platform.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author guoj
 * @description: 测试用例
 * @date 2024/7/16 9:37
 */
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Data
@Entity
@Table(name = "t_requirement_deploy_branch")
public class RequirementDeplolyBranch {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "branch_id", columnDefinition = "int comment '唯一编号'")
    private Long branchId;

    @Column(name = "gitee_database_id", columnDefinition = "varchar(100) comment '仓库id'")
    private String giteeDatabaseId;

    @Column(name = "gitee_database_name", columnDefinition = "varchar(100) comment '仓库名称'")
    private String giteeDatabaseName;

    @Column(name = "gitee_branch_name", columnDefinition = "varchar(600) comment '分支名称'")
    private String giteeBranchName;

    @ApiModelProperty(value = "备注")
    @Column(name = "vc_remark", columnDefinition = "varchar(1000) comment '备注'")
    private String remark;

    @ApiModelProperty(value = "发起时间")
    @org.hibernate.annotations.CreationTimestamp
    @Column(name = "create_time", columnDefinition = "datetime comment '发起时间'")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime CreateTime;

    @ApiModelProperty(value = "更新时间")
    @org.hibernate.annotations.UpdateTimestamp
    @Column(name = "dt_update_time", columnDefinition = "datetime comment '更新时间'")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

//    @ApiModelProperty(value = "测试用例列表")
//    @Transient
//    private List<RequirementTeskCase> testCaseList;
}
